# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Department


@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):
    list_display = ['name', 'parent', 'manager', 'is_active', 'created_time']
    list_filter = ['is_active', 'created_time']
    search_fields = ['name', 'description']
    ordering = ['name']
    
    fieldsets = (
        ('基本信息', {
            'fields': ('name', 'description', 'parent', 'manager')
        }),
        ('状态', {
            'fields': ('is_active',)
        }),
    )